home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.6 KB | 91 lines | [TEXT/GEOL] |
- Item 3426824 17-Sept-90 16:40PDT
-
- From: AFTERHOURS After Hours SW,Richard Wolpert,PRT
-
- To: MACDTS Macintosh Developer Tech Supt
- MACAPP.TECH$ MacApp Technical
-
- cc: AFTERHOURS After Hours SW,Richard Wolpert,PRT
-
- Sub: 'Phantom' Handles...
-
-
- TO: MAC.DTS, MACAPP.TECH$
- FR: AFTERHOURS
- RE: Extra Handles...
-
- "Me and handles, we don't get along..."
-
- I am having a problem with an extra 'phantom' handle appearing after I display
- a small window with the following code in a DoChoice method of a dialog box:
-
- PROCEDURE TMyDialog.DoChoice (origView: TView; itsChoice: INTEGER); OVERRIDE;
- VAR
- aPassword : Str255;
- attempt : Str255;
- aWindow : TWindow;
- aDialog : TDialogView;
- anEntry : TEditText;
- continue: BOOLEAN;
- aDismisser : IDType;
- BEGIN
- IF origView.fIdentifier = 'pass' THEN BEGIN
-
- continue := FALSE;
- aPassword := gPreferences^^.passWord;
-
- ProgramBreak('before making...');
-
- aWindow := NewTemplateWindow(5010, NIL);
- aDialog := TDialogView(aWindow.FindSubView('DLOG'));
- anEntry := TEditText(aWindow.FindSubView('ntry'));
-
- ProgramBreak('before asking...');
-
- aDismisser := aDialog.PoseModally;
- anEntry.GetText(attempt);
- aWindow.Close;
- aWindow.Free;
-
- ProgramBreak('after freeing...');
-
- IF aDismisser = 'OKHT' THEN BEGIN
-
- IF (attempt = aPassword) THEN
- continue := TRUE;
-
- END;
-
- IF continue THEN BEGIN
-
- { do whatever here... }
-
- END;
-
- END ELSE
- INHERITED DoChoice(origView, itsChoice);
- END;
-
- After the window is closed and freed, a check in MacsBug with 'ht' shows that
- there is an extra relocatable handle created, which I cannot account for. What
- makes this problem even more disturbing for me is that this problem is occuring
- in another section of my application, and I cannot trace it down as narrowly as
- I have with this occurance. The characterstics of these 'phantom' handles are
- such that I cannot even identify it, because each varies in size over a wide
- range from 4 to 100 or so bytes big, or sometimes the total size of relocatable
- blocks shrinks, meaning that the handle is negative in size (??? can't be!).
-
- The view template resource simply contains a TWindow, a TDialogView, a
- TDialogTEView, a TStaticText view, and a TButton.
-
- In previous projects, I have never run in any troubles such as these with views
- and handles... If anyone has any clue as to where these handles are coming
- from, please link me directly. Thanks...
-
- Despirately frustrated, I remain,
-
- Danny Cooley
- After Hours Software
- ALink: AFTERHOURS
-
-